//
//  CheckDetailViewModel.m
//  HonlivApp
//
//  Created by admin on 2017/6/27.
//  Copyright © 2017年 honliv. All rights reserved.
//

#import "CheckDetailViewModel.h"
#import "CheckInfoModel.h"
#import "CheckResultModel.h"

static NSString *const checkDetailInfo_url = @"api/Account/GetOuptExamResult";

@implementation CheckDetailViewModel

-(void)getCheckDetailInfo:(void (^)(CheckResultModel *))completion{
    NSDictionary *dic = @{@"exam_no":self.infoModel.examNo};
    NSString *url = [NSString stringWithFormat:@"%@%@",HOSPITAL_URL,checkDetailInfo_url];
    [NetWorker getCommonDatasWithURLStr:url body:dic success:^(id result) {
        NSArray *resultArr = [JsonHelper arrayWithJsonString:result[@"Entity"]];
        NSDictionary *dic = resultArr[0];
        CheckResultModel *model = [CheckResultModel checkResultWithDic:dic];
        completion(model);
    } failure:^(id result) {
        [SVProgressHUD showErrorWithStatus:@"暂时没有数据"];
    }];

}

@end
